<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="utf-8" />
    <title>账号登录-{eyou:global name='web_name' /}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <link href="{eyou:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {eyou:static file="users/skin/css/basic.css" /}
    {eyou:static file="users/skin/css/eyoucms.css" /}
    {eyou:include file="users/skin/css/diy_css.htm" /}
    {eyou:static file="/public/static/admin/font/css/iconfont.css"/}

    {eyou:static file="/public/static/common/js/jquery.min.js"/}
    {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
    {eyou:static file="users/skin/js/global.js" /}
  </head>

  <body class="reg login">
    <div class="register_index ey-member">
        <div class="container">
            <div class="form-register panel-body fv-form">
                <div class="mip-reg-logo">
                    <a href="{eyou:global name='web_cmsurl' /}" class="ey-logo"><img src="{eyou:global name='web_logo'/}" /></a>
                </div>
                <div class="mip-reg-heading">
                    <div class="tab_list">
                        <ul>
                            <li data-index="0" class="current">账号登录</li>
                            <li data-index="1">手机登录</li>
                        </ul>
                    </div>
                </div>
                <div class="tab_con">
                    <div class="item" style="display: block;">
                        <form action="" name='theForm' id="theForm" method="post" class="form-register ">
                            <div class="form-group group_z">
                                <input type="text" name="username" value="" id="username" required class="form-control h60" placeholder="用户名" autocomplete="off" />
                            </div>
                            <div class="form-group group_z">
                                <input type="password" name="password" value="" id="password" required class="form-control h60" placeholder="登录密码" autocomplete="off" />
                                <span class="paw-on-off"><i class="iconfont e-yincang"></i></span>
                            </div>
                            {eyou:eq name="$is_vertify" value="1"}
                            <div class="form-group group_z">
                                <div class="input-group-icon">
                                    <div class="formText">
                                    <input type="text" name="vertify" id="vertify" autocomplete="off" class="form-control h60" placeholder="图片验证码" />
                                    <img src="{eyou:url link='api/Ajax/vertify' vars='type=users_login' /}" class="chicuele" id="imgVerifys" onclick="fleshVerify();" title="看不清？点击更换验证码" align="absmiddle"> </div>
                                </div>
                            </div>
                            {/eyou:eq}
                            <input type="hidden" name="referurl" value="{$referurl}"/>
                            <input type="hidden" name="website" value="website"/>
                            <input type="button" name="submit" value="登录" class="btn btn-lg btn-primary btn-block group_z h60 disabled-button" id="submitButton" disabled="disabled"/>
                            <div class="login-link clearfix"> 
                                <a class="login-link-reg" href="{eyou:url link='user/Users/reg' /}">账号注册</a> 
                                <a class="" href="{eyou:url link='user/Users/retrieve_password' /}">忘记密码</a>
                            </div>
              
                            <!-- 第三方账号登录 --> 
                            {eyou:if condition="!empty($weapp_wxlogin) || !empty($weapp_qqlogin) || !empty($weapp_wblogin)"}
                            <div class="qrcode-title">其它登录方式</div>
                            <div class="login_type text-xs-center m-t-20">
                                <!-- <p>第三方账号登录</p> -->
                                <ul class="blocks-3 m-0">
                                    {eyou:notempty name="$weapp_qqlogin"}
                                    <li class="m-b-0"><a title="QQ登录" href="{eyou:url link='plugins/QqLogin/login' seo_pseudo='1' seo_inlet='0' /}"><img title="QQ" src="{eyou:static file='users/skin/images/login_qq.png' /}"></a></li>
                                    {/eyou:notempty}
                            
                                    {eyou:notempty name="$weapp_wxlogin"}
                                    <li class="m-b-0"><a title="微信登录" href="{eyou:url link='plugins/WxLogin/login' seo_pseudo='1' seo_inlet='0' /}"><img title="微信" src="{eyou:static file='users/skin/images/login_wx.png' /}"></a></li>
                                    {/eyou:notempty}
                            
                                    {eyou:notempty name="$weapp_wblogin"}
                                    <li class="m-b-0"><a title="微博登录" href="{eyou:url link='plugins/Wblogin/login' seo_pseudo='1' seo_inlet='0' /}"><img title="微博" src="{eyou:static file='users/skin/images/login_wb.png' /}"></a></li>
                                    {/eyou:notempty}
                                </ul>
                            </div>
                            {/eyou:if}
                            <!-- 第三方账号登录 -->
                        </form>
                    </div>
                    
                    <div class="item">
                        {eyou:static file="/public/static/common/js/mobile_login.js"/}
                        <form action="" name='theMobileForm' id="theMobileForm" method="post" class="form-register ">
                            <div class="form-group group_z">
                                <input id="mobile" type="text" name="mobile" value="" required class="form-control h60" placeholder="请输入手机号" autocomplete="off" />
                            </div>
                            <div class="form-group group_z" id="vertify_div">
                                <div class="input-group-icon">
                                    <div class="formText">
                                        <input id="mobile_vertify" type="text" name="mobile_vertify" autocomplete="off" class="form-control h60" placeholder="输入验证码" />
                                        <img src="{eyou:url link='api/Ajax/vertify' vars='type=users_mobile_login' /}" class="chicuele" id="mobile_imgVerifys" onclick="mobile_fleshVerify();" title="看不清？点击更换验证码" align="absmiddle">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group group_z">
                                <div class="input-group btn-direction">
                                    <div class="formText">
                                        <input id="mobile_code" type="text" class="form-control h60" id="mobile_code" name="mobile_code" placeholder="手机验证码">
                                    </div>
                                    <input type="button" id="mobile_code_button" onclick="send_mobile_code();" class="btn btn-primary sento" value="点击发送">
                                </div>
                            </div>
                            
                            <input type="hidden" name="referurl" value="{$referurl}" />
                            <input type="hidden" name="website" value="website" />
                            <input type="hidden" name="__mobile_1_token__" value="{$Request.token.__mobile_1_token__}" />
                            <input id="mobile_submitButton" type="button" onclick="checkMobileUserLogin1649732103();" class="btn btn-lg btn-primary btn-block group_z h60 disabled-button" value="登录"  disabled="disabled"/>
                            <div class="login-link">
                                <a class="login-link-reg" href="{eyou:url link='user/Users/reg' /}">账号注册</a> 
                                <a href="{eyou:url link='user/Users/retrieve_password' /}">忘记密码</a> 
                            </div>
                            <!-- 第三方账号登录 -->
                            {eyou:if condition="!empty($weapp_wxlogin) || !empty($weapp_qqlogin) || !empty($weapp_wblogin)"}
                            <div class="qrcode-title">其它登录方式</div>
                            <div class="login_type text-xs-center m-t-20">
                                <!-- <p>第三方账号登录</p> -->
                                <ul class="blocks-3 m-0">
                                    {eyou:notempty name="$weapp_qqlogin"}
                                    <li class="m-b-0"><a title="QQ登录" href="{eyou:url link='plugins/QqLogin/login' seo_pseudo='1' seo_inlet='0' /}"><img title="QQ" src="{eyou:static file='users/skin/images/login_qq.png' /}"></a></li>
                                    {/eyou:notempty}
                            
                                    {eyou:notempty name="$weapp_wxlogin"}
                                    <li class="m-b-0"><a title="微信登录" href="{eyou:url link='plugins/WxLogin/login' seo_pseudo='1' seo_inlet='0' /}"><img title="微信" src="{eyou:static file='users/skin/images/login_wx.png' /}"></a></li>
                                    {/eyou:notempty}
                            
                                    {eyou:notempty name="$weapp_wblogin"}
                                    <li class="m-b-0"><a title="微博登录" href="{eyou:url link='plugins/Wblogin/login' seo_pseudo='1' seo_inlet='0' /}"><img title="微博" src="{eyou:static file='users/skin/images/login_wb.png' /}"></a></li>
                                    {/eyou:notempty}
                                </ul>
                            </div>
                            {/eyou:if}
                            <!-- 第三方账号登录 -->
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        //切换账号登录与手机号登录
        $(".tab_list li").click(function(){
            var index = $(this).attr('data-index');
            $(".tab_list li").each(function(){
                $(this).removeClass('current');
            });
            $(".item").each(function(i,v){
                if (index == i){
                    $(this).css('display','block');
                } else{
                    $(this).css('display','none');
                }
            });
            $(this).addClass('current');

        });
        //密码明文、隐藏
        $('.paw-on-off').on('click',function(){
            var inputPaw=$('input[name=password]');
            var icon=$(this).children('i');
            if(icon.hasClass('iconfont e-yincang')){
                icon.removeClass('iconfont e-yincang');
                icon.addClass('iconfont e-zhengkai');
                inputPaw.attr('type','text');
            }else{
                icon.removeClass('iconfont e-zhengkai');
                icon.addClass('iconfont e-yincang');
                 inputPaw.attr('type','password');
            }
        });
        
        $(document).keydown(function(event) {
            if (event.keyCode == 13) {
                var index = $(".tab_list .current").attr('data-index');
                if (0 == index) {
                    $('input[name=submit]').trigger("click");
                }else if(1 == index){
                    checkMobileUserLogin1649732103();
                }
            }
        });
        
        var input = document.getElementById('username');
        var input = document.getElementById('password');
        {eyou:eq name="$is_vertify" value="1"}
        var input = document.getElementById('vertify');
        {/eyou:eq}
        var submitButton = document.getElementById('submitButton');
        input.addEventListener('input', function() {
          if (input.value.length > 0) {
            submitButton.disabled = false;
            submitButton.classList.remove('disabled-button');
            submitButton.classList.add('enabled-button');
          } else {
            submitButton.disabled = true;
            submitButton.classList.remove('enabled-button');
            submitButton.classList.add('disabled-button');
          }
        });
        
        var mobile_input = document.getElementById('mobile');
        var mobile_input = document.getElementById('mobile_vertify');
        var mobile_input = document.getElementById('mobile_code');
        var mobile_submitButton = document.getElementById('mobile_submitButton');
        mobile_input.addEventListener('input', function() {
          if (mobile_input.value.length > 0) {
            mobile_submitButton.disabled = false;
            mobile_submitButton.classList.remove('disabled-button');
            mobile_submitButton.classList.add('enabled-button');
          } else {
            mobile_submitButton.disabled = true;
            mobile_submitButton.classList.remove('enabled-button');
            mobile_submitButton.classList.add('disabled-button');
          }
        });
        
        function fleshVerify() {
            var src = "{eyou:url link='api/Ajax/vertify' vars='type=users_login' /}";
            if (src.indexOf('?') > -1) {
                src += '&';
            } else {
                src += '?';
            }
            src += 'r=' + Math.floor(Math.random() * 100);
            $('#imgVerifys').attr('src', src);
        }

        $(function() {
            $('input[name=submit]').on('click', function() {
                
                var formData = $('#theForm').serialize();
                {$pwdJsCode|default=''}
                layer_loading('正在处理');
                $.ajax({
                    // async:false,
                    url: "{eyou:url link='user/Users/login' /}",
                    data: formData,
                    type: 'post',
                    dataType: 'json',
                    success: function(res) {
                        if (1 == res.code) {
                            if (5 == res.data.status) {
                                layer.alert(res.msg, {
                                    icon: 5,
                                    title: false,
                                    closeBtn: false
                                }, function() {
                                    window.location.href = res.url;
                                });
                            } else {
                                window.location.href = res.url;
                            }
                        } else {
                            layer.closeAll();
                            if ('vertify' == res.data.status) {
                                fleshVerify();
                            }

                            if (2 == res.data.status) {
                                showErrorAlert(res.msg, 4);
                            } else {
                                layer.msg(res.msg, {
                                    icon: 5,
                                    time: 1500
                                });
                            }
                        }
                    },
                    error: function(e) {
                        layer.closeAll();
                        showErrorAlert(e.responseText);
                    }
                });
            });
        });
    </script>

</body>
</html>